import request from '@/utils/request'

// 模拟登录接口
export function login(username, password) {
  // 模拟登录逻辑
  if (username === 'admin' && password === 'abc123') {
    // 模拟成功响应
    return Promise.resolve({
      code: '200',
      message: '登录成功',
      data: {
        token: `token-${Date.now()}`,
        userInfo: {
          username: 'admin',
          avatar: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png'
        }
      }
    })
  } else {
    // 模拟失败响应
    return Promise.resolve({
      code: '400',
      message: '用户名或密码错误',
      data: null
    })
  }
}